package com.jhws.business.repair.bo;

public class RepairConstant {
    /*报修进度*/
    public static int REPAIR_STATE_UNTREATED = 0; //未处理
    public static int REPAIR_STATE_ACCEPTED = 1; //已经受理
    public static int REPAIR_STATE_COMPLETE = 2; //维修完成
    public static int REPAIR_STATE_ALL = 3; //查询全部

    public static int REPAIR_NOT_DELETE = 0; //未删除
    public static int REPAIR_DELETE = 1; //已删除


    //报修类型
    public static enum REPAIR_TYPE {
        AIR_COND(1, "空调"), LIGHT(2, "电灯"), FRIDGE(3, "冰箱"),
        ELEVATOR(4, "电梯"), WATER_PIPE(5, "水管"), NETWORK(6, "网络"),
        WATER_LEAKAGE(7, "漏水"), COMM_FACILITIES(8, "公共设施"), OTHER(9, "其他");
        // 成员变量
        private String name;
        private int index;

        REPAIR_TYPE(int index, String name) {
            this.name = name;
            this.index = index;
        }

        public static String getName(int index) {
            for (REPAIR_TYPE repairType : REPAIR_TYPE.values()) {
                if (repairType.getIndex() == index) {
                    return repairType.name;
                }
            }
            return null;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }
    }
}
